package com.nuoniu.sibanyun.mapper.crm;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.nuoniu.sibanyun.entity.crm.CrmQuotedPrice;
import com.nuoniu.sibanyun.mapper.provider.CrmQuotedMapperProvider;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Component;

/**
 * <p>
 * 报价单 Mapper 接口
 * </p>
 *
 * @author baiqiang
 * @since 2020-06-22
 */
@Component
@Mapper
public interface CrmQuotedPriceMapper extends BaseMapper<CrmQuotedPrice> {

    /**
     * 修改所属客户
     * @author 小啊刚
     * @date 2020/6/22
     */
    @Update("update crm_quoted_price set crm_id = #{newCrmId}, crm_name = #{crmName}, update_user_id = #{userId}, update_user_name = #{realName}, update_date = now() where crm_id = #{crmId}")
    void updateCrmId(Integer crmId, Integer newCrmId, String crmName, Integer userId, String realName);

    /**
     * 分页查询列表
     * @author 小啊刚
     * @date 2020/6/24
     */
    @SelectProvider(type = CrmQuotedMapperProvider.class, method = "quotedPriceList")
    Page<CrmQuotedPrice> pageQuotedPrice(Page page, CrmQuotedPrice price);
}
